{include file="public/header" /}

<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>{$page_title}</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>

    <form method="get" name="formSearch" id="formSearch">
        <div class="sc-search-form">

            <dl>
                <dd>
                    {sctaglib:dcselect list=":dict_get('inviter_type')" class="w-100" name="member_type" value="$Request.param.inviter_type" default="全部" /}
                </dd>
                <dd>
                    <select name="search_field_name" >
                        <option {if $search_field_name == 'member_name'}selected='selected'{/if} value="member_name">账号</option>
                        <option {if $search_field_name == 'member_email'}selected='selected'{/if} value="member_email">{$Think.lang.member_index_email}</option>
                        <option {if $search_field_name == 'member_mobile'}selected='selected'{/if} value="member_mobile">手机号码</option>
                        <option {if $search_field_name == 'member_truename'}selected='selected'{/if} value="member_truename">{$Think.lang.member_index_true_name}</option>
                        <option {if $search_field_name == 'inviter_name'}selected='selected'{/if} value="inviter_name">{$Think.lang.inviter_name}</option>
                    </select>
                </dd>
                <dd>
                    <input type="text" value="{$search_field_value}" name="search_field_value" class="txt">
                </dd>
            </dl>
            <dl>
                <dt>邀请码</dt>
                <dd><input type="text" value="{$Request.get.inviter_id|default=''}" name="inviter_id" id="inviter_id" class="txt"></dd>
            </dl>
            <div class="btn_group">
                <input type="submit" class="btn" value="搜索">
            </div>
        </div>
    </form>


    <table class="sc-default-table">
      <thead>
        <tr class="thead">
          <th>&nbsp;</th>
          <th colspan="2">{$Think.lang.sc_shop}</th>
            <th class="align-center">类型</th>
          <th class="align-center">销售总额</th>
          <th class="align-center">手机号</th>
          <th class="align-center">邀请人</th>
          <th class="align-center">邀请码</th>
          <th class="align-center">已邀请人数</th>
          <th class="align-center">{$Think.lang.sc_state}</th>
          <th class="align-center">注册时间</th>
          <th class="align-center">{$Think.lang.sc_handle}</th>
        </tr>
      </thead>
      <tbody>
        {notempty name="member_list"}
        {foreach name="member_list" item="v" key="k" }
        <tr class="hover member">
          <td class="w24"><input type="checkbox" name='del_id[]' value="{$v.member_id}" class="checkitem"></td>
          <td class="w48 picture">
              <div class="size-44x44">
              <span class="thumb"><i></i>
                  <img src="{:get_member_avatar($v.member_avatar)}?{:microtime()}"  width="44" height="44"/>
              </span>
          </div>
          </td>
          <td><p class="name">
              <strong>{$v.member_name}</strong>({$Think.lang.inviter_name}: {$v.inviter_name})</p>
            <p class="smallfont">{$Think.lang.member_index_reg_time}:&nbsp;{$v.member_addtime|date='Y-m-d',###}</p>
            
              <div class="im"><span class="email" >
                {if $v.member_email != ''}
                <a href="mailto:{$v.member_email}" class=" yes" title="{$Think.lang.member_index_email}:{$v.member_email}">{$v.member_email}</a></span>
                {else /}
                <a href="JavaScript:void(0);" class="" title="{$Think.lang.member_index_null}" >{$v.member_email}</a></span>
               {/if}
                {if $v.member_ww != ''}
                <!--<a target="_blank" href="http://web.im.alisoft.com/msg.aw?v=2&uid={$v.member_ww}&site=cnalichn&s=11" class="" title="WangWang: {$v.member_ww}"><img border="0" src="http://web.im.alisoft.com/online.aw?v=2&uid={$v.member_ww}&site=cntaobao&s=2&charset=utf-8" /></a>-->
                {/if}
                {if $v.member_qq != ''}
                <a target="_blank" href="{$Think.HTTP_TYPE}wpa.qq.com/msgrd?v=3&uin={$v.member_qq}&site=qq&menu=yes" class=""  title="QQ: {$v.member_qq}"><img border="0" src="{$Think.HTTP_TYPE}wpa.qq.com/pa?p=2:{$v.member_qq}:52"/></a>
                {/if}
               <!--{if $v.member_mobile != ''}-->
               <!--<div>{$v.member_mobile}</div>-->
               <!--{/if}-->
                  {if $v.inviter_areainfo != ''}
                  <div>注册地址：{$v.inviter_areainfo}</div>
                  {/if}
              </div></td>
            <td class="align-center"> {:dict_convert('inviter_type', $v.inviter_type)}</td>
          <td class="align-center">{$v.inviter_goods_amount}</td>
            <td class="align-center">{$v.member_mobile_encryption}</td>
          <td class="align-center">{$v.inviter_parent_name}</td>
          <td class="align-center">
              <p>{$v.inviter_id}</p>
          </td>
            <td>{$v.invitation_num}</td>
          <td class="align-center">{$v.inviter_state|dict_convert='inviter_state',###}</td>

          <td class="align-center">{$v.inviter_applytime|date='Y-m-d',###}</td>
          <td class="align-center">

              <a href="{:url('Shop/memberinfo',['member_id'=>$v.member_id])}" class="dsui-btn-view"><i class="fa"></i>{$Think.lang.sc_view}</a>
              {if $v.member_state == 1}
              <a href="javascript:scLayerConfirm('{:url('Shop/memberstate',['member_id'=>$v.member_id,'member_state'=>0])}','{$Think.lang.sc_ensure_disable}')" class="dsui-btn-del"><i class="fa"></i>冻结</a>
              {else/}
              <a href="javascript:scLayerConfirm('{:url('Shop/memberstate',['member_id'=>$v.member_id,'member_state'=>1])}','{$Think.lang.sc_ensure_enable}')" class="dsui-btn-add"><i class="fa"></i>{$Think.lang.sc_active}</a>
              {/if}
              <a href="{:url('Predeposit/pdlog_list',['mname'=>$v.member_name])}" class="dsui-btn-view"><i class="fa"></i>余额明细</a>
              <!--<a href="{:url('address/index',['member_id' => $v.member_id])}" class="dsui-btn-view"><i class="fa"></i>地址簿</a>-->
          </td>
        </tr>
        {/foreach}
        {else /}
        <tr class="no_data">
          <td colspan="11">{$Think.lang.sc_no_record}</td>
        </tr>
        {/notempty}
      </tbody>
      <tfoot class="tfoot">
        {notempty name="member_list"}
        <tr>
        <td class="w24"><input type="checkbox" class="checkall" id="checkallBottom"></td>
          <td colspan="16">
          <label for="checkallBottom">{$Think.lang.sc_select_all}</label>
              &nbsp;&nbsp;<a href="JavaScript:void(0);" class="btn btn-small" onclick="submit_disable_batch()"><span>冻结</span></a>
              &nbsp;&nbsp;<a href="JavaScript:void(0);" class="btn btn-small" onclick="submit_enable_batch()"><span>{$Think.lang.sc_active}</span></a>
          </td>
        </tr>
        {/notempty}
      </tfoot>
    </table>
    {$show_page}

</div>
<script>
function submit_disable_batch() {
    var ids_str=batch_items();
    _uri = ADMINSITEURL+"/Shop/memberstate.html?member_state=0&member_id=" + ids_str;
    scLayerConfirm(_uri,'{$Think.lang.sc_ensure_disable}');
}
function submit_enable_batch() {
    var ids_str=batch_items();
    _uri = ADMINSITEURL+"/Shop/memberstate.html?member_state=1&member_id=" + ids_str;
    scLayerConfirm(_uri,'{$Think.lang.sc_ensure_enable}');
}
function batch_items(){
    /* 获取选中的项 */
    var items = '';
    $('.checkitem:checked').each(function () {
        items += this.value + ',';
    });
    if (items != '') {
        items = items.substr(0, (items.length - 1));

    }
    return items;
}
</script>